package naga.x.util;

import java.util.zip.CRC32;

public class CRC {

	public static long crc32(byte[] data) {
		CRC32 crc = new CRC32();
		crc.update(data);
		return crc.getValue();
	}
	
	public static int crc32int(byte[] data) {
		return (int) crc32(data);
	}
	
	public static long crc32(byte[] data, int off, int len) {
		CRC32 crc = new CRC32();
		crc.update(data, off, len);
		return crc.getValue();
	}
	
	public static int crc32int(byte[] data, int off, int len) {
		return (int) crc32(data, off, len);
	}
	
	
}
